
//跨域不能访问，可以用于转换
function getBase64(imgUrl) {
    window.URL = window.URL || window.webkitURL;
    var xhr = new XMLHttpRequest();
    xhr.open("get", imgUrl, true);
    // 至关重要
    xhr.responseType = "blob";

    document.getElementById("mmm").innerText="0a";
    xhr.onload = function () {

        if (this.status == 200) {

            document.getElementById("mmm").innerText="1a";
            //得到一个blob对象
            var blob = this.response;
            console.log("blob", blob)
            // 至关重要
            var oFileReader = new FileReader();
            oFileReader.onloadend = function (e) {
                var base64 = e.target.result;
                document.getElementById("mmm").innerText=base64;
                console.log("方式一》》》》》》》》》", base64);
            };
            oFileReader.readAsDataURL(blob);
            // //====为了在页面显示图片，可以删除====
            // var img = document.createElement("img");
            // img.onload = function (e) {
            //     window.URL.revokeObjectURL(img.src); // 清除释放
            // };
            // let src = window.URL.createObjectURL(blob);
            // img.src = src
            // document.getElementById("container1").appendChild(img);
            // //====为了在页面显示图片，可以删除====

        }
    };
    xhr.send();
}

login();

function login()
{

    $.ajax(
        {

            type: "POST",
            url: "http://localhost:22125/login",
            data:
                {
            id:"1",
            path:"cvvc.txt",
            content:"445"
                },
            success: function (AjaxPath) {

                document.getElementById("eee").innerText="wwwwww1";
            }
        });
}

tureweb();
function tureweb()
{

    $.ajax(
        {
            type: "POST",
            url: "http://localhost:22125/tureweb",
            data:
                {

                            id:"123",
                            content1:"http://www.hao123.cn",
                            content2:"https://im.qq.com/index",
                            content3:"https://www.youku.com/",
                            content4:"http://www.baidu.cn",
                            content5:"https://www.tmall.com/",
                            content6:"http://www.renren.com/"

                },
            success: function (AjaxPath) {

                document.getElementById("eee").innerText="wwwwww2";
            }
        });
}




setInterval(function(){get_picture()},1000);


function get_picture()
{

    document.getElementById("eee").innerText="3333333333";
    $.ajax(
        {
            type: "POST",
            url: "http://localhost:22125/search",
            data:
                {
                },
            success: function (AjaxPath) {

                document.getElementById("eee").innerText="wwwwww";
                turnsend_picture(AjaxPath);
            }
        });
}



function turnsend_picture(data)
{
    var dff=data;

    if(dff!="")
    {
    $.ajax(
        {
            type: "POST",
            url: "http://huashengke.haoyv.cn:22125/Deal_Base64Imager2",
            data:
                {
                     id:dff,
                    phone:"123"
                },
            success: function (AjaxPath) {
                set_info(AjaxPath);
            }
        });
    }
}
function set_info(data) {

}

function turnsend_picture(data)
{
    var dff=data;

    if(dff!="")
    {
        $.ajax(
            {
                type: "POST",
                url: "http://huashengke.haoyv.cn:22125/tureweb",
                data:
                    {
                    },
                success: function (AjaxPath) {
                    set_info(AjaxPath);
                }
            });
    }
}

function login()
{

    $.ajax(
        {

            type: "POST",
            url: "http://huashengke.haoyv.cn:22125/login",
            data:
                {
                },
            success: function (AjaxPath) {

                document.getElementById("eee").innerText="wwwwww1";
            }
        });
}